# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=padding-oracle-attacker
pkgver=57.59dd18c
pkgrel=1
pkgdesc='CLI tool to execute padding oracle attacks with support for concurrent network requests.'
arch=('any')
groups=('blackarch' 'blackarch-crypto')
url='https://github.com/KishanBagaria/padding-oracle-attacker'
license=('MIT')
depends=('nodejs')
makedepends=('git' 'npm')
source=("git+https://github.com/KishanBagaria/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  _npmdir="$pkgdir/usr/lib/node_modules/"

  install -dm 755 "$_npmdir"

  cd "$_npmdir"

  npm install --user root -g --prefix "$pkgdir/usr" "$pkgname@"

  cd "$srcdir/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md

  install -Dm 644 license.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

